package com.java.datastructures.doublecyclelinkedlist;

/**
 * @author wangning
 * @create 2021-06-20 22:08
 */
public class TestDoubleCycleNode {
	public static void main(String[] args) {
		//创建节点
		DoubleCycleNode n1 = new DoubleCycleNode(1);
		DoubleCycleNode n2 = new DoubleCycleNode(2);
		DoubleCycleNode n3 = new DoubleCycleNode(3);

		//追加节点
		n1.after(n2);
		n2.after(n3);
		//查看上一个，自己，下一个节点的内容
		System.out.println(n2.pre.getData());
		System.out.println(n2.getData());
		System.out.println(n2.next.getData());
		System.out.println(n3.next().getData());
		System.out.println(n1.pre.getData());
	}
}
